import Layout from '@/layout'
export const constantRoutes = [{
  path: '/login',
  name: 'login',
  component: () => import('@/views/login/index.vue'),
  hidden: true
},
{
  path: '/404',
  component: () => import('@/views/404.vue'),
  hidden: true
},
{
  path: '/',
  component: Layout,
  redirect: '/home',
  children: [{
    path: '/home',
    name: 'home',
    component: () => import('@/views/home/index.vue'),
    meta: {
      title: '首页', // 左侧显示的菜单名称
      icon: 'home', // 目录icon下的svg图片名称
      roles: [7, 8] // 路由菜单权限，7是学校角色ID，8是老师角色ID
    }
  }]
},
{
  path: '/prepare',
  component: Layout,
  redirect: '/prepare/index',
  meta: {
    title: '备课',
    icon: 'prepare',
    roles: [8]
  },
  children: [{
    path: '/prepare/index',
    name: 'prepare_index',
    component: () => import('@/views/prepare/index/index.vue'),
    meta: {
      title: '备课',
      icon: 'prepare',
      roles: [8]
    }
  },
  {
    path: '/prepare/step1',
    name: 'prepare_step1',
    component: () => import('@/views/prepare/step1/index.vue'),
    meta: {
      title: '备课操作',
      icon: 'prepare',
      roles: [8]
    },
    hidden: true
  }
  ]
},
{
  path: '/teaching',
  component: Layout,
  redirect: '/teaching/index',
  meta: {
    title: '授课',
    icon: 'teaching',
    roles: [8]
  },
  children: [{
    path: '/teaching/index',
    name: 'teaching_index',
    component: () => import('@/views/teaching/index/index.vue'),
    meta: {
      title: '授课',
      icon: 'teaching',
      roles: [8]
    }
  },
  {
    path: '/teaching/step1',
    name: 'teaching_step1',
    component: () => import('@/views/teaching/step1/index.vue'),
    meta: {
      title: '授课操作',
      icon: 'edit',
      roles: [8]
    },
    hidden: true
  }
  ]
},
{
  path: '/attendance',
  component: Layout,
  redirect: '/attendance/index',
  meta: {
    title: '考勤',
    icon: 'attendance',
    roles: [8]
  },
  children: [{
    path: '/attendance/index',
    name: 'attendance_index',
    component: () => import('@/views/attendance/index/index.vue'),
    meta: {
      title: '考勤',
      icon: 'attendance',
      roles: [8]
    }
  },
  {
    path: '/attendance/step1',
    name: 'attendance_step1',
    component: () => import('@/views/attendance/step1/index.vue'),
    meta: {
      title: '课时选择',
      icon: 'form',
      roles: [8]
    },
    hidden: true
  },
  {
    path: '/attendance/step2',
    name: 'attendance_step2',
    component: () => import('@/views/attendance/step2/index.vue'),
    meta: {
      title: '考勤统计',
      icon: 'form',
      roles: [8]
    },
    hidden: true
  }
  ]
},
{
  path: '/users',
  component: Layout,
  redirect: '/users/index',
  meta: {
    title: '我的资料',
    icon: 'user',
    roles: [8]
  },
  children: [{
    path: '/users/index',
    name: 'users_index',
    component: () => import('@/views/users/index/index.vue'),
    meta: {
      title: '我的资料',
      icon: 'user',
      roles: [8]
    }
  }]
},
{
  path: '/courseware',
  component: Layout,
  redirect: '/courseware/add',
  meta: {
    title: '创建课程',
    icon: 'course',
    roles: [7]
  },
  children: [{
    path: '/courseware/add',
    name: 'courseware_add',
    component: () => import('@/views/courseware/add/index.vue'),
    meta: {
      title: '创建课程',
      icon: 'course',
      roles: [7]
    }
  }]
},
{
  path: '/courseware/manage',
  component: Layout,
  redirect: '/courseware/index',
  meta: {
    title: '课程管理',
    icon: 'course',
    roles: [7]
  },
  children: [{
    path: '/courseware/index',
    name: 'courseware_index',
    component: () => import('@/views/courseware/index/index.vue'),
    meta: {
      title: '课程管理',
      icon: 'course',
      roles: [7]
    }
  },
  {
    path: '/courseware/edit',
    name: 'courseware_edit',
    component: () => import('@/views/courseware/edit/index.vue'),
    meta: {
      title: '编辑课程',
      icon: 'course'
    },
    hidden: true
  },
  {
    path: '/courseware/detail',
    name: 'courseware_detail',
    component: () => import('@/views/courseware/detail/index.vue'),
    meta: {
      title: '课程详情',
      icon: 'course'
    },
    hidden: true
  }
  ]
},
{
  path: '/goods',
  name: 'goods',
  component: Layout,
  redirect: '/goods/index',
  meta: {
    title: '购买课程',
    icon: 'goods',
    roles: [7]
  },
  children: [{
    path: '/goods/index',
    name: 'goods_index',
    component: () => import('@/views/goods/index/index.vue'),
    meta: {
      title: '购买课程',
      icon: 'goods',
      roles: [7]
    }
  },
  {
    path: '/goods/detail',
    name: 'goods_detail',
    component: () => import('@/views/goods/detail/index.vue'),
    meta: {
      title: '课程详情',
      icon: 'goods'
    },
    hidden: true
  }
  ]
},
{
  path: '/carts',
  name: 'carts',
  component: Layout,
  redirect: '/carts/index',
  meta: {
    title: '购物车',
    icon: 'carts',
    roles: [7]
  },
  children: [{
    path: '/carts/index',
    name: 'carts_index',
    component: () => import('@/views/carts/index/index.vue'),
    meta: {
      title: '购物车',
      icon: 'carts',
      roles: [7]
    }
  }],
  hidden: true
},
// {
//   path: '/prepare',
//   name: 'prepare',
//   component: Layout,
//   redirect: '/prepare/manage',
//   meta: {
//     title: '备课管理',
//     icon: 'prepare',
//     roles: [7]
//   },
//   children: [{
//     path: '/prepare/manage',
//     name: 'prepare_manage',
//     component: () => import('@/views/prepare/manage/index.vue'),
//     meta: {
//       title: '备课管理',
//       icon: 'prepare',
//       roles: [7]
//     }
//   },
//   {
//     path: '/prepare/detail',
//     name: 'prepare/detail',
//     component: () => import('@/views/prepare/detail/index.vue'),
//     meta: {
//       title: '备课详情',
//       icon: 'prepare'
//     },
//     hidden: true
//   }
//   ]
// },
{
  path: '/teaching',
  name: 'teaching',
  component: Layout,
  redirect: '/teaching/manage',
  meta: {
    title: '授课管理',
    icon: 'teaching',
    roles: [7]
  },
  children: [{
    path: '/teaching/manage',
    name: 'teaching/manage',
    component: () => import('@/views/teaching/manage/index.vue'),
    meta: {
      title: '授课管理',
      icon: 'teaching',
      roles: [7]
    }
  },
  {
    path: '/teaching/detail',
    name: 'teaching_detail',
    component: () => import('@/views/teaching/detail/index.vue'),
    meta: {
      title: '授课详情',
      icon: 'teaching'
    },
    hidden: true
  }
  ]
},
{
  path: '/attendance',
  name: 'attendance',
  component: Layout,
  redirect: '/attendance/manage',
  meta: {
    title: '考勤管理',
    icon: 'attendance',
    roles: [7]
  },
  children: [{
    path: '/attendance/manage',
    name: 'attendance/manage',
    component: () => import('@/views/attendance/manage/index.vue'),
    meta: {
      title: '考勤管理',
      icon: 'attendance',
      roles: [7]
    }
  },
  {
    path: '/attendance/detail',
    name: 'attendance/detail',
    component: () => import('@/views/attendance/detail/index.vue'),
    meta: {
      title: '考勤详情',
      icon: 'attendance'
    },
    hidden: true
  }
  ]
},
{
  path: '/userscourse',
  name: 'userscourse',
  component: Layout,
  redirect: '/users/course',
  meta: {
    title: '我的课程',
    icon: 'user',
    roles: [7]
  },
  children: [{
    path: '/users/course',
    name: 'users_course',
    component: () => import('@/views/users/course/index.vue'),
    meta: {
      title: '我的课程',
      icon: 'user',
      roles: [7]
    }
  },
  {
    path: '/users/coursedetail',
    name: 'users_course_detail',
    component: () => import('@/views/users/course/detail/index.vue'),
    meta: {
      title: '课程详情',
      icon: 'user'
    },
    hidden: true
  },
  {
    path: '/users/coursechapter',
    name: 'users_course_chapter',
    component: () => import('@/views/users/course/chapter/index.vue'),
    meta: {
      title: '课程详情',
      icon: 'user'
    },
    hidden: true
  }
  ]
},
{
  path: '*',
  redirect: '/404', // 404 page must be placed at the end !!!
  hidden: true
}
]
